#ifndef ROLLCADRESORTFILTERPROXYMODEL_H
#define ROLLCADRESORTFILTERPROXYMODEL_H

#include <QSortFilterProxyModel>
#include <QStringList>
#include <QColor>

class RollCadreSortFilterProxyModel : public QSortFilterProxyModel
{
    Q_OBJECT

public:
    RollCadreSortFilterProxyModel(QObject *parent=0);
    QVariant data(const QModelIndex &item, int role=Qt::DisplayRole) const;
    bool setData( const QModelIndex &index, const QVariant &value, int role );
    Qt::ItemFlags flags(const QModelIndex &index) const;
    QMap<int,Qt::CheckState>  checkStateMap;
    QMap<int,QColor>  colormap;
    void setSex(QStringList sex);
    void setPolitic(QStringList politic);
    void setCadreName(QString cadrename);
    void setPostName(QString postname);
    void setExperPost(QString experpost);
    void setExperUnit(QString experunit);
    void setUnitName(QString unitname);
    void setSchool(QString school);
    void setMajor(QString major);
    void setWorkSchool(QString workschool);
    void setWorkMajor(QString workmajor);
    void setFileRecv(QString filerecv);
    void setNativePlace(QStringList native);
    void setBirthplace(QStringList birthplace);
    void setGrowPlace(QStringList growplace);
    void setBirth(QStringList birth);
    void setAge(QStringList age);
    void setJoinWorkTime(QStringList joinworktime);
    void setPartyTime(QStringList partytime);
    void setRankTime(QStringList ranktime);
    void setRankYear(QStringList rankyear);
    void setPostTime(QStringList posttime);
    void setPostYear(QStringList postyear);
    void setManageStatus(QStringList managestatus);
    void setThreeOne(QStringList threeone);
    void setExperNull(QStringList expernull);
    void setFamilyUnit(QString familyunit);
    void setFamilyPro(QString familypro);
    void setNation(QStringList nationList);
    void setRank(QStringList rankList);
    void setPostCategoryList(QStringList postcategoryList);
    void setFile(QStringList isfileList);
    void setManageStatusList(QStringList managestatusList);
    void setWorkEducationList(QStringList workeducationList);
    void setWorkDegreeList(QStringList workdegreeList);
    void setEducationList(QStringList educationList);
    void setDegreeList(QStringList degreeList);
    void setUnitList(QStringList unitList);
    void setUnitGradationList(QStringList unitgradationList);
    void setUnitNatrueList(QStringList unitnatrueList);
    void setUnitCategoryList(QStringList unitcategoryList);
    void setUnitOfCategoryList(QStringList unitofcategoryList);
    void setUnitLevelList(QStringList unitlevelList);
    void setSubUnitList(QStringList subunitList);
    void setCheckYear(QStringList checkyear);
    void setOrRelation(QString orrelation);

    QHash<QString,int> columnhash;

protected:
    bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;

private:
    QStringList fsex,fpolitic,fbirth,fage,fjoinworktime,fpartytime,fnative,fbirthplace,fgrowplace,
                franktime,frankyear,fposttime,fpostyear,fmanagestatus,fthreeone,
                fexpernull,fnationList,frankList,fisfileList,fmanagestatusList,
                fworkeducationList,fworkdegreeList,feducationList,fdegreeList,funitList,
                funitgradationList,funitnatrueList,funitcategoryList,funitofcategoryList,
                funitlevelList,fsubunitList,fpostcategoryList,fcheckyear;
    QString fcadrename,fpostname,fexperpost,fexperunit,funitname,fschool,fmajor,
            fworkschool,fworkmajor,ffilerecv,ffamilyunit,ffamilypro,forrelation;



};

#endif // ROLLCADRESORTFILTERPROXYMODEL_H
